getAudioInputStream can not convert [stereo, 4 bytes/frame] stream to [mono, 2 bytes/frame]
Posted
by brian_d
on Stack Overflow
See other posts from Stack Overflow
or by brian_d
Published on 2010-05-14T21:49:28Z
Indexed on
2010/05/14
21:54 UTC
Read the original article
Hit count: 421
Hello.
I am using javasound and have an AudioInputStream of format
PCM_SIGNED 8000.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian
Using AudioSystem.getAudioInputStream(target_format, original_stream)
produces an 'IllegalArgumentException: Unsupported Conversion' when the target_format is PCM_SIGNED 8000.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian
Is it possible to convert this stream manually after every read() call? And if yes, how?
In general, how can you compare two formats and tell if a conversion is possible?
© Stack Overflow or respective owner